package design.simdi.code.final_paper.site.panels.blog;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.MesajDao;
import design.simdi.code.final_paper.core.entities.Mesaj;

/**
 * 
 * @author Marius Dumitriu - (Jun 25, 2010 - 8:41:38 PM)
 * 
 */
public class DetachableMesajModel extends LoadableDetachableModel<Mesaj> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final MesajDao mesajDao;

	public DetachableMesajModel(Mesaj object, MesajDao mesajDao) {
		super(object);
		this.id = object.getId();
		this.mesajDao = mesajDao;
	}

	@Override
	protected Mesaj load() {
		return mesajDao.get(id);
	}

}
